//
//  DestinationCell.m
//  We_Travel
//
//  Created by lanou3g on 15/12/11.
//  Copyright © 2015年 lanou3g. All rights reserved.
//

#import "DestinationCell.h"
#import "Destination.h"
#import "UIImageView+WebCache.h"

@implementation DestinationCell

- (void)setDestination:(Destination *)destination
{
    self.nameLabel.text = destination.name;
    self.timeLabel.text = [NSString stringWithFormat:@"适合%ld-%ld天",destination.min_days,destination.max_days];
    self.timeLabel.layer.borderWidth = 0.5f;
    self.timeLabel.layer.masksToBounds = YES;
    self.timeLabel.layer.cornerRadius = 5;
    NSString *address = [NSString string];
    for (NSString *str in destination.tags) {
        address = [address stringByAppendingString:str];
        address = [address stringByAppendingString:@" "];
    }
    self.introduceLabel.text = address;
    [self.firstImageView sd_setImageWithURL:[NSURL URLWithString:destination.images[0]]];
    [self.secondImageView sd_setImageWithURL:[NSURL URLWithString:destination.images[1]]];
    [self.thirdImageView sd_setImageWithURL:[NSURL URLWithString:destination.images[2]]];
    [self.fouthImageView sd_setImageWithURL:[NSURL URLWithString:destination.images[3]]];
    NSString *didian = [NSString string];
    for (NSString *str in destination.periphery) {
        didian = [didian stringByAppendingString:str];
        didian = [didian stringByAppendingString:@" "];
    }
    self.arroundLabel.text = didian;
    self.checkImageView.hidden = !destination.isSelected;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
